﻿using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using DBSourceToolsLib;
using DBConnectionLib;
//using NUnit.Extensions;

//namespace TestDBSourceToolsLibNUnit
//{
//    [TestFixture]
//    public class TestForm_NewProjectForm
//    {
//        [Test]
//        public void TestEnabledButtons()
//        {
//            using (DBSourceToolsLib.DatabaseProjectUI.NewProjectForm oNewProjectForm
//                = new DBSourceToolsLib.DatabaseProjectUI.NewProjectForm())
//            {
//                oNewProjectForm.Show();

//                NUnit.Extensions.Forms.TextBoxTester m_textBoxProjectName = new NUnit.Extensions.Forms.TextBoxTester("m_textBoxProjectName");
//                NUnit.Extensions.Forms.TextBoxTester m_textBoxBaseDirectory = new NUnit.Extensions.Forms.TextBoxTester("m_textBoxBaseDirectory");
//                NUnit.Extensions.Forms.TextBoxTester m_textBoxDatabaseNick = new NUnit.Extensions.Forms.TextBoxTester("m_textBoxDatabaseNick");
//                NUnit.Extensions.Forms.ButtonTester btnBrowse = new NUnit.Extensions.Forms.ButtonTester("btnBrowse");
//                NUnit.Extensions.Forms.ButtonTester btnSelectDatabase = new NUnit.Extensions.Forms.ButtonTester("btnSelectDatabase");
//                NUnit.Extensions.Forms.ButtonTester btnOk = new NUnit.Extensions.Forms.ButtonTester("btnOk");
//                NUnit.Extensions.Forms.ButtonTester btnCancel = new NUnit.Extensions.Forms.ButtonTester("btnCancel");

//                Assert.IsTrue(m_textBoxProjectName.Properties.Enabled == true, " m_textBoxProjectName should be enabled");
//                Assert.IsTrue(m_textBoxBaseDirectory.Properties.Enabled == false, " m_textBoxBaseDirectory should not be enabled");
//                Assert.IsTrue(btnBrowse.Properties.Enabled == false, " btnBrowse should not be enabled");
//                Assert.IsTrue(btnSelectDatabase.Properties.Enabled == false, " btnSelectDatabase should not be enabled");
//                Assert.IsTrue(btnOk.Properties.Enabled == false, " btnOk should not be enabled");
//                Assert.IsTrue(btnCancel.Properties.Enabled == true, " btnCancel should not be enabled");

//            }
//        }

//        [Test]
//        public void TestEnterNameAndBaseDirectory()
//        {
//            using (DBSourceToolsLib.DatabaseProjectUI.NewProjectForm oNewProjectForm
//                = new DBSourceToolsLib.DatabaseProjectUI.NewProjectForm())
//            {
//                oNewProjectForm.Show();

//                NUnit.Extensions.Forms.TextBoxTester m_textBoxProjectName = new NUnit.Extensions.Forms.TextBoxTester("m_textBoxProjectName");
//                NUnit.Extensions.Forms.TextBoxTester m_textBoxBaseDirectory = new NUnit.Extensions.Forms.TextBoxTester("m_textBoxBaseDirectory");
//                NUnit.Extensions.Forms.TextBoxTester m_textBoxDatabaseNick = new NUnit.Extensions.Forms.TextBoxTester("m_textBoxDatabaseNick");
//                NUnit.Extensions.Forms.ButtonTester btnBrowse = new NUnit.Extensions.Forms.ButtonTester("btnBrowse");
//                NUnit.Extensions.Forms.ButtonTester btnSelectDatabase = new NUnit.Extensions.Forms.ButtonTester("btnSelectDatabase");
//                NUnit.Extensions.Forms.ButtonTester btnOk = new NUnit.Extensions.Forms.ButtonTester("btnOk");
//                NUnit.Extensions.Forms.ButtonTester btnCancel = new NUnit.Extensions.Forms.ButtonTester("btnCancel");

//                m_textBoxProjectName.Properties.Text = "testProject";
//                Assert.IsTrue(m_textBoxBaseDirectory.Properties.Enabled == true, " m_textBoxBaseDirectory should be enabled");
//                Assert.IsTrue(btnBrowse.Properties.Enabled == true, " btnBrowse should be enabled");

//                m_textBoxBaseDirectory.Properties.Text = @"S:\DBSourceTools_root\TestFiles\DatabaseProject";

//                Assert.IsTrue(btnSelectDatabase.Properties.Enabled == true, " btnSelectDatabase should be enabled");

//                Stubs.NewDatabaseProjectFormStub oStub = new TestDBSourceToolsLibNUnit.Stubs.NewDatabaseProjectFormStub();
//                oNewProjectForm.SetDatabase(oStub.GetDatabaseObject());
//                m_textBoxDatabaseNick.Properties.Text = oStub.GetDatabaseObject().NickName;

//                Assert.IsTrue(btnOk.Properties.Enabled == true, " btnOk should be enabled");

//            }
//        }

//        [Test]
//        public void TestGetNewDatabaseProject()
//        {
//            using (DBSourceToolsLib.DatabaseProjectUI.NewProjectForm oNewProjectForm
//                = new DBSourceToolsLib.DatabaseProjectUI.NewProjectForm())
//            {
//                oNewProjectForm.Show();

//                NUnit.Extensions.Forms.TextBoxTester m_textBoxProjectName = new NUnit.Extensions.Forms.TextBoxTester("m_textBoxProjectName");
//                NUnit.Extensions.Forms.TextBoxTester m_textBoxBaseDirectory = new NUnit.Extensions.Forms.TextBoxTester("m_textBoxBaseDirectory");
//                NUnit.Extensions.Forms.TextBoxTester m_textBoxDatabaseNick = new NUnit.Extensions.Forms.TextBoxTester("m_textBoxDatabaseNick");
//                NUnit.Extensions.Forms.ButtonTester btnBrowse = new NUnit.Extensions.Forms.ButtonTester("btnBrowse");
//                NUnit.Extensions.Forms.ButtonTester btnSelectDatabase = new NUnit.Extensions.Forms.ButtonTester("btnSelectDatabase");
//                NUnit.Extensions.Forms.ButtonTester btnOk = new NUnit.Extensions.Forms.ButtonTester("btnOk");
//                NUnit.Extensions.Forms.ButtonTester btnCancel = new NUnit.Extensions.Forms.ButtonTester("btnCancel");

//                m_textBoxProjectName.Properties.Text = "testProject";
//                m_textBoxBaseDirectory.Properties.Text = @"S:\DBSourceTools_root\TestFiles\DatabaseProject";
//                Stubs.NewDatabaseProjectFormStub oStub = new TestDBSourceToolsLibNUnit.Stubs.NewDatabaseProjectFormStub();
//                oNewProjectForm.SetDatabase(oStub.GetDatabaseObject());
//                m_textBoxDatabaseNick.Properties.Text = oStub.GetDatabaseObject().NickName;

//                DBSourceToolsLib.DatabaseProject oDatabaseProject = oNewProjectForm.GetDatabaseProject();
//                Assert.IsNotNull(oDatabaseProject);
//                Assert.AreEqual(@"S:\DBSourceTools_root\TestFiles\DatabaseProject", oDatabaseProject.BaseDirectory);

//                m_textBoxBaseDirectory.Properties.Text = @"S:\DBSourceTools_root\TestFiles\DatabaseProject2";
//                Assert.AreEqual(@"S:\DBSourceTools_root\TestFiles\DatabaseProject2", oDatabaseProject.BaseDirectory);
//                DBSourceToolsLib.SourceDatabase oSource = oDatabaseProject.SourceDatabases[0];
//                Assert.IsNotNull(oSource);
//                Assert.AreEqual(@"S:\DBSourceTools_root\TestFiles\DatabaseProject2\TestNick", oSource.BaseDirectory);

//            }
//        }

//    }
//}
